<!DOCTYPE html>
<html>

<head>
    <title>游记列表</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/travel.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script src="/js/plugins/jquery-form/jquery.form.js"></script>
    <link rel="stylesheet" href="js/plugins/bootstrap-fs-modal-master/dist/css/fs-modal.min.css"/>
    <script src="js/plugins/bootstrap-fs-modal-master/dist/js/fs-modal.min.js"></script>
    <script>

        setTimeout(function() {
            // IE
            if(document.all) {
                document.getElementById("clickMe").click();
            }
            // 其它浏览器
            else {
                var e = document.createEvent("MouseEvents");
                e.initEvent("click", true, true);
                document.getElementById("clickMe").dispatchEvent(e);
            }
        }, 10);

        $(function () {

            $(".btnQu").click(function () {
            $.get("/visas", {pageSize:0}, function (data) {
                $("#allTravels").renderValues(data,{
                    setHref:function (item, value) {
                        $(item).attr("href",$(item).data("href") + value);
                    }
                });
            })
            })

            $(".btnHo").click(function () {
            $.get("/visas/country/1",function (data) {
                console.log(data);
                $("#allTravels").renderValues({list:data},{
                    setHref:function (item, value) {
                        $(item).attr("href",$(item).data("href") + value);
                    }
                });
            })
            })
        })
    </script>

    <style>
        .color{
            color: #D99531;
            position: relative;
            width: 120px;
            font-family: "Microsoft YaHei", "宋体", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;

        }
        .price{
            color: red;
            padding: 5px;
            height: 30px;
        }
    </style>
</head>

<body>

<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="index.html">
                <span><i class="fa fa-chevron-left fa-2x"></i></span>
            </a>
        </div>
        <div class="col-10">
            <div class="input-group-sm search">
                <input class="form-control searchBtn" placeholder="搜国家">
            </div>
        </div>
    </div>
</div>

<button type="button" class="btn btn-primary btnQu" data-toggle="modal" data-target="#myyModal" id="clickMe">
    全部国家
</button>
<button type="button" class="btn btn-success btnHo" data-toggle="modal" data-target="#myyModal">
    热门国家
</button>

<div class="container">
    <div id="allTravels">

        <div render-loop="list">
        <div class="row detail" >

            <div class="col bigimg">
                <img render-src="list.visaCountry.coverUrl">
            </div>

            <div class="col color">
                <a data-href="/visaTravelAgency.html?visaCountryId=" render-fun="setHref" render-key="list.visaCountry.id">
                <h3 render-html="list.visaCountry.country"></h3>
                    <div class="price"><h3 render-html="list.price"></h3>RMB起~</div>

                </a>

            </div>

        </div>
        </div>

    </div>
</div>

<!-- 模态窗口 -->
<div class="modal fade modal-fullscreen" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h7 class="modal-title" id="myModalLabel">有问题都可以在这和各地的朋友分享哦!</h7>
            </div>
            <div class="modal-body">
                <form action="/travelQuestions/save" method="post" id="editform">
                    <input type="hidden" name="user.id" render-value="id">
                    <textarea name="question" id="txt1" rows="10" cols="60"></textarea>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary submitbtn">保存</button>
            </div>
        </div>
    </div>
</div>

</body>

</html>